home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group92c.txt
/
000095_icon-group-sender _Fri Nov 20 12:48:54 1992.msg
< prev
next >
Wrap
Internet Message Format
|
1993-01-04
|
1KB
Received: by cheltenham.cs.arizona.edu; Fri, 20 Nov 1992 11:12:02 MST
Date: Fri, 20 Nov 92 12:48:54 EST
From: Paul_Abrahams@MTS.cc.Wayne.edu
To: icon-group@cs.arizona.edu
Message-Id: <530200@MTS.cc.Wayne.edu>
Subject: Scanning a list of items
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
The Icon Analyst #15 describes several versions of code to scan and
process a list of items. The list has the form of a string with markers
between items but without a marker after the last item. An unattractive
solution is
text ||:= marker
text ? {
while process(tab(find(marker))) do
=marker
}
A better solution suggested by the Analyst is
text ? {
while process(tab(find(marker)|0)) do
=marker | break
}
But here's another alternative, which is what I've usually done:
(text || marker) ? {
while process(tab(find(marker))) do
=marker
}
As to which of the alternatives is better, de gustibus non est
disputandum.
Paul Abrahams